 /*
  * Copyright (c) 2006, 2023, wuyahan 编写
  *
  */
 package com.repair.config;

 import com.repair.interceptor.LoginInterceptor;
 import org.springframework.boot.SpringBootConfiguration;
 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

 /**
  * <p>Project: server_zhang - MyWebMvcConfig
  * <p>Powered by wuyahan On 2023-04-11 08:42:40
  *
  * @author wuyahan [tianwenle2000@163.com]
  * @version 1.0
  * @since 17
  */
 @SpringBootConfiguration
 @EnableWebMvc
 public class MyWebMvcConfig implements WebMvcConfigurer {


//     @Override
//     public void addInterceptors(InterceptorRegistry registry) {
//         // 所有的请求都经过这个过滤器
//         registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").order(1);
//     }

     private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"};


     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry) {
         registry.addResourceHandler("/upload/**").addResourceLocations("file:D:\\work\\gra\\server_zhang\\src\\main\\resources\\upload").addResourceLocations("classpath:/upload/");
//         registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");

     }


 }
